import { Howl } from "howler";
export const SoundTools = async (file: Blob): Promise<Howl> => {
  const base64Str = await blobToDataURI(file);
  const sound = new Howl({
    src: [base64Str],
  });
  return sound;
};
export function blobToDataURI(blob: Blob): Promise<string> {
  return new Promise((resolve) => {
    var reader = new FileReader();
    reader.readAsDataURL(blob);
    reader.onload = (e) => {
      resolve(e.target?.result as string);
    };
  });
}
